package com.jxauaia.contest.model.dto;

import lombok.Data;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.Pattern;

@Data
public class RegisterDTO {
    @NotBlank(message = "用户名不能为空")
    @Size(min = 4, max = 20, message = "用户名长度必须在4-20个字符之间")
    @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "用户名只能包含字母、数字和下划线")
    private String username;
    
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;
    
    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度必须在6-20个字符之间")
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{6,}$", 
             message = "密码必须包含至少一个大写字母、一个小写字母和一个数字")
    private String password;
    
    @NotBlank(message = "确认密码不能为空")
    private String confirmPassword;
    
    @NotBlank(message = "验证码不能为空")
    private String captchaCode;
    
    private String captchaId;
    
    @Pattern(regexp = "^$|^[1-9]\\d*$", message = "证件类型格式不正确")
    private String idType;
    
    @Pattern(regexp = "^$|^[1-9]\\d*$", message = "证件号码格式不正确")
    private String idNumber;
    
    @Size(max = 100, message = "学校名称不能超过100个字符")
    private String university;
    
    @Size(max = 50, message = "专业名称不能超过50个字符")
    private String major;
}